<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    #app{
        width: 300px;
        height: 300px;
        background-color: aqua;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 30px;
        color: blue;
    }
</style>
<body>
    <h1>今天吃什么?</h1>
    <div id="app">1234</div>
    
    <div>
        <button id="goto" onclick="ddd()">点点点</button>
        <button id="www" onclick="bbb()">停停停</button>
    </div>
</body>
<script>
    let name=['鱼香肉丝米饭','水果捞','鸭腿饭','火锅','烤肉','麻辣烫','烤冷面']
    let timer=null,index=0
   
    let content=document.getElementById('app')
    // let hyh=document.getElementById('goto')
    content.innerText=name[index]
    function ddd(){
         timer=setInterval(()=>{
             index=Math.floor(Math.random()*name.length)
            content.innerText=name[index]
        },80)
    }
    function bbb(){
        clearInterval(timer)
        return false
    }
</script>
</html>